<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>

        // 数组结构
        // let arr = [1,2,3];
        // // let a = arr[0];
        // // let b = arr[1];
        // // let c = arr[2];

        // let [a,b,c] = arr;
        // console.log(a,b,c);

        // 对象结构
        const person = {
            name: "Jack",
            age: 18,
            language: ['java','js','css']
        }

        // const name = person.name;
        // const age = person.age;
        // const language = person.language;

        const {name:abc,age,language} = person;

        console.log(abc,age,language);
        
        // 字符串扩展
        let str = "hello.vue";
        console.log(str.startsWith("hello"));
        console.log(str.endsWith(".vue"));
        console.log(str.includes("el"));
        console.log(str.includes("hello"));
        
        // 多行字符串 ``飘号
        let ss = `<div>
                    <span>hello world</span>
                  </div>`;
        console.log(ss);
        
        // 字符串中插入变量和表达式，变量名写在 ${} 中，${} 中可以放入 JavaScript 表达式
        let info = `我是${abc},今年${age + 10}岁了`;
        console.log(info);
        
        // 字符串中调用函数
        function fun() {
            return "这是一个函数";
        }
        info = `我是${abc},今年${age + 10}岁了,我想说：${fun()}`;
        console.log(info);
        
    </script>


</body>
</html>